<?php

class friends_util_invitation {
	static function genLink($uid, $code){
		return "http://".$_SERVER['HTTP_HOST']
			.Controller::_makeURL('friends', 'invitation', 'inviting', 
				array('uid'=>$uid, 'invite_code'=>self::genCode($uid,$code)));
	}
	
	static function genCode($uid, $code){
		$args = func_get_args();
		$args = array_slice($args, 2);
		return md5($uid.$code.implode('',$args));
	}
}